package com.thread;

public class MyRunnable2 implements Runnable {
    private int count=0;
    @Override
    public void run() {

       while(true) {

            synchronized (this){
                if (count==30){
                        break;
            }
                count++;
                System.out.println(
                        Thread.currentThread().getName()+":"+
                                "第"+count+"份试卷");

            }

        }
    }
}
